package webbandidong.auth;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

public abstract class AuthAdminAbstractController extends AbstractController {

    @Override
    protected ModelAndView handleRequestInternal(
            HttpServletRequest request,
            HttpServletResponse response)
            throws Exception {
        if (!CheckAuth.checkAdminAuth(request, response)) {
            return null;
        }
        else {
            ModelAndView mv = handleAuthRequestInternal(request, response);
            return mv;
        }
    }

    public abstract ModelAndView handleAuthRequestInternal(
            HttpServletRequest request,
            HttpServletResponse response) throws Exception;
}
